package com.mk.domain;

import com.github.d925529.apidoc.annotation.ApiField;
import org.beetl.sql.core.annotatoin.*;
import org.beetl.sql.core.mapper.BaseMapper;

import java.io.Serializable;
import java.util.List;

/**
 * 说明：用户角色
 * 作者：刘永盛
 * 日期：2018-7-30 11:48:40
 * 版本：1.0.0
 */
@Table(name = "cp_role_user")
@SuppressWarnings("unused")
public class CpRoleUser implements Serializable {
    @AssignID
    //角色ID
    @ApiField("角色ID")
    private String roleid;

    @AssignID
    //userid
    @ApiField("userid")
    private String userid;


    /**
     * @return 角色ID
     */
    public String getRoleid() {
        return roleid;
    }

    /**
     * @param roleid 角色ID
     */
    public void setRoleid(String roleid) {
        this.roleid = roleid;
    }

    /**
     * @return userid
     */
    public String getUserid() {
        return userid;
    }

    /**
     * @param userid userid
     */
    public void setUserid(String userid) {
        this.userid = userid;
    }


    public interface Mapper extends BaseMapper<CpRoleUser> {
        @SqlStatement(type = SqlStatementType.UPDATE)
        int saveUserRoles(@Param("roleids") List<String> roleids, @Param("userid") String userid);

        int deleteUserRoles(@Param("userid") String userid);
    }
}